# $Id$
# Maintainer: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=cdrdao
pkgver=1.2.3
pkgrel=10
arch=('i686' 'x86_64')
license=('GPL')
url="http://cdrdao.sourceforge.net/"
pkgdesc='Records audio/data CD-Rs in disk-at-once (DAO) mode'
depends=('gcc-libs' 'lame' 'libmad' 'libvorbis' 'libao')
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2
        cdrdao-1.2.3-autoconf-update.patch
        cdrdao-1.2.3-k3b.patch
        cdrdao-1.2.3-stat.patch
        cdrdao-1.2.3-format_security.patch
        cdrdao-1.2.3-narrowing.patch)
sha256sums=('8193cb8fa6998ac362c55807e89ad0b3c63edc6b01afaeb3d5042519527fb75e'
            '2f4f54ed23b4f3b22fd64a2a3d4fa67ff186b3865213cba3fbe81ed9f6c42c74'
            '6eddd7c79f548b3ad1d8d4ce23367bcae3cd6dee74f0aeb6439758d6599090e0'
            'ca89b7c56a376d5a9574c5757f0d372236a895334f81867ff5e1703806565bbc'
            '7909a3ad290d45fd2db5059025bf219be7b77af60050a409a3dc2a41a4859fe3'
            '6222e307ebabe5149f88d64ef2cee7bf2a44588b9022babb7071bb87c224cae6')

prepare() {
  cd ${pkgname}-${pkgver}
  
  patch -Np1 -i ../cdrdao-1.2.3-autoconf-update.patch
  patch -Np1 -i ../cdrdao-1.2.3-k3b.patch
  patch -Np1 -i ../cdrdao-1.2.3-stat.patch
  patch -Np1 -i ../cdrdao-1.2.3-format_security.patch
  patch -Np1 -i ../cdrdao-1.2.3-narrowing.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr \
	--mandir=/usr/share/man \
	--sysconfdir=/etc \
	--without-xdao --with-lame \
	--with-ogg-support --with-mp3-support
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
